class Solution {
public:
    int fib(int n) {
        int m=0,h=1,i,sum;
       if (n < 2) 
        {
            return n;
        }
        for (i = 2; i <= n; ++i) {
            sum = m + h;
            m = h;
            h = sum;
        }
        return sum;
    }
}